<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%
String mpath = request.getContextPath();
String basePath = request.getScheme() + "://"
		+ request.getServerName() + ":" + request.getServerPort()
		+ mpath;
%>		
<style>
input[type="text"]{
    color: #000000
}
</style>
<form class="form-horizontal" id="formDialog">
	 <div class="form-group">
		<label class="col-sm-2 control-label no-padding-right" for="deptEnname">责任人</label>
		<div class="col-sm-4">
			<select class ="pType" id="resUserId" style="height:30px;width:150px;" onchange="this.parentNode.nextSibling.value=this.value">
										<option value ="">　请选择责任人　</option>
										<c:forEach items="${zeList}" var = "pt">
											<option value ="${pt.sysId}" ${nodes.resUserId==pt.sysId?'selected':''}>${pt.name}</option>
										</c:forEach>
			</select>
		</div>
		<label class="col-sm-2 control-label no-padding-right" for="deptEnname">经办人</label>
		<div class="col-sm-4">
			<select class ="pType" id="operatorUserId" style="height:30px;width:150px;" onchange="this.parentNode.nextSibling.value=this.value">
										<option value ="">　请选择经办人　</option>
										<c:forEach items="${jbList}" var = "pt">
											<option value ="${pt.sysId}" ${nodes.operatorUserId==pt.sysId?'selected':''}>${pt.name}</option>
										</c:forEach>
			</select>
		</div>
	 </div> 
		
		
		<input hidden name="projectId" id="projectId" value="${projectId }">
		<input hidden name="sysId" id="sysId" value="${sysId }">

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="deptEnname">计划用时</label>
		<div class="col-sm-4">
			<input type="text" name="planTime" id="planTime"
				placeholder="请输入计划用时" value="${nodes.planTime }"
				class="form-control">
		</div>
		<label class="col-sm-2 control-label no-padding-right"
			for="deptEnname">计划日期</label>
		<div class="col-sm-4">
			<div class="col-xs-8 col-sm-12" style="padding: 0;width: 47%;float: left;">
				<div class="input-group">
					<input type="text" name="planBeginDate" id="planBeginDate"  class="form-control date-picker"
						   autocomplete="off" placeholder="计划开始日期"  value="${nodes.planBeginDate }" />
					
				</div>
			</div>	
			<div class="col-xs-8 col-sm-12" style="padding: 0;width: 47%;float: left;margin-left: 6%">
				<div class="input-group">
					<input type="text" name="planFinishDate" id="planFinishDate"  class="form-control date-picker"
						   autocomplete="off" placeholder="计划完成日期"  value="${nodes.planFinishDate }" />
					
				</div>
			</div>	
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="deptEnname">实际用时</label>
		<div class="col-sm-4">
			<input type="text" name="factTime" id="factTime"
				placeholder="请输入实际用时" value="${nodes.factTime }"
				class="form-control">
		</div>
		<label class="col-sm-2 control-label no-padding-right"
			for="deptEnname">实际日期</label>
		<div class="col-sm-4">
			<div class="col-xs-8 col-sm-12" style="padding: 0;width: 47%;float: left;">
					<div class="input-group">
						<input type="text" name="factBeginDate" id="factBeginDate"  class="form-control date-picker"
							   autocomplete="off" placeholder="实际开始日期"  value="${nodes.factBeginDate }" />
						
					</div>
				</div>	
				<div class="col-xs-8 col-sm-12" style="padding: 0;width: 47%;float: left;margin-left: 6%">
					<div class="input-group">
						<input type="text" name="factFinishDate" id="factFinishDate"  class="form-control date-picker"
						 placeholder="实际完成日期"  value="${nodes.factFinishDate }" />
						
				</div>
			</div>
			
		</div>
	</div>
	<div class="form-group">
	<label class="col-sm-2 control-label no-padding-right"
			for="deptEnname">状态</label>
		<div class="col-sm-4">
			<input type="text" name="status" id="status"
				placeholder="请输入状态" value="${nodes.status }"
				class="form-control required">
		</div>
	<div>
	<div class="form-group">
		<button type='button' style="float: right;margin-right: 20px" class='btn btn-default' data-dismiss='modal'>关闭</button>
		<button type='button' style="float: right;margin-right: 20px" class='btn btn-pink' onclick='reset()'>重置</button>
		<button type='button' style="float: right;margin-right: 20px" class='btn btn-primary' onclick='setNodes()'>设置</button>
		<div style="clear: both;"></div>
	</div>
</form>
	<script src="<s:url value="/assets/js/chosen.jquery.js"></s:url>"></script>
<script type="text/javascript">
	function setNodes(){
		var sysId = $('#sysId').val();
		
		/* var resUser = $("#resUser").val();
		var resUserPhone = $('#resUserPhone').val();
		
		var operatorUser = $("#operatorUser").val();
		var operatorPhone = $('#operatorPhone').val(); */
		var resUserId=$("#resUserId").val();
		var operatorUserId = $('#operatorUserId').val();
		var planTime = $('#planTime').val();
		var planBeginDate = $('#planBeginDate').val();
		var planFinishDate = $('#planFinishDate').val();
		var status= $('#status').val();
		var factTime = $('#factTime').val();
		var factBeginDate = $('#factBeginDate').val();
		var factFinishDate = $('#factFinishDate').val();
		$.ajax({
	  		  url:'<%=basePath %>/bnp/project/setNodeInfo',
	  		  type:'post',
	  		  dataType:'json',
	  		  data:{'sysId':sysId,'resUserId':resUserId,'operatorUserId':operatorUserId,'status':status
	  			  ,'planTime':planTime,'planBeginDate':planBeginDate,'planFinishDate':planFinishDate
	  			  ,'factTime':factTime,'factBeginDate':factBeginDate,'factFinishDate':factFinishDate},
	  		  success:function(data){
	  			  if(data.code==200){
	  				  /* window.location.reload(); */
	  				  seachJqgird("#gridTable","#formDialog form");
	  				$("#formDialog").modal('hide');
	  			  }
	  		  },
	  		  error:function(){
	  			  alert("请求异常");
	  		  }
	  	});
	}
	function reset(){
		$("#resUserId").val("");
		$('#operatorUserId').val("");
		$('#planTime').val("");
		$('#planBeginDate').val("");
		 $('#planFinishDate').val("");
		$('#status').val("");
		$('#factTime').val("");
		 $('#factBeginDate').val("");
		 $('#factFinishDate').val("");
	}
</script>
<script type="text/javascript">
			jQuery(function($) {
				$('.date-picker').datepicker({
					inline: true,
					format:"yyyy.mm.dd",
					autoclose: true,
					todayHighlight: true,
					language: 'cn'
				})
				//show datepicker when clicking on the icon
				.next().on(ace.click_event, function(){
					$(this).prev().focus();
				});
			});
</script>
